package com.demo2do.fms.queue.dao;

import java.util.Date;
import java.util.List;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.demo2do.fms.entity.vehicle.source.RemoteTransMeans;
import com.demo2do.fms.entity.vehicle.source.VehicleGpsInfo;

/**
 *
 * @author Ark
 *
 */
@Dao("hibernate")
public interface RemoteTransMeansDao {

    /**
     * @param vehicleId
     * @param lastModified
     * @return
     */
    @Query("FROM VehicleGpsInfo WHERE vid = :vid AND lastModified > :lastModified")
    public List<VehicleGpsInfo> listLatestGps(@Variable("vid") Long vehicleId, @Variable("lastModified") Date lastModified);
    
    /**
     * @param code
     * @return
     */
    @Query("FROM RemoteTransMeans WHERE disabled = false AND code = :code")
    public RemoteTransMeans loadByCode(@Variable("code") String code);
    
}
